<div class="container">
  <div class="span-17  main-content">
  <h1>Popis grupa</h1>
  
  <% @sections.each do |section| %>
  <% if section.count_available_groups(current_member) > 0%>
    <table class="admin">
      <tr>
          <th class="admin medium"></th>

        <th class="admin"><%= section.name %></th>
        <th class="admin narrow">Rasprava</th>
        <th class="admin narrow">Korisnika</th>
      </tr>
    
    
    
    <% section.groups.each do |group| %>
	    <% if group_permission? group %>
	      <tr>
	          <td class="admin medium">
	            <% if group_new_posts? group  %>
	            	<%= image_tag 'forum_icons/new.png'%>
	            <% else %>
	            	<%= image_tag 'forum_icons/no_new.png'%>
	            <% end %>
	          </td>
	        <td class="admin">
	        	<% if current_member and current_member.is_in_group?(group) %>
	              <%= image_tag('forum_icons/follow.png', :class => "follow") %>
	     	    <% end %>
	        	<b><%= link_to group.name, group.url %> </b>
	        	<%= group.description%>
	        </td>   
	        
	        <td class="admin narrow"> <%= group.groups_threads.count %></td>
	        <td class="admin narrow"> <%= group.members.count %></td>
	      </tr>
	    <% end %>
    <% end %>
    </table>
  <% end %>
  <% end %>
  
  <br />
  
  <% if moderator? %>
  	<div class="admin_links">
    	<%= link_to 'Stvori grupu', new_group_path %> 
    	<%= link_to 'Stvori sekciju', new_groups_section_path %>
    </div>
  <% end %>
</div>
<%= render 'shared/sidebar'%>
</div>